﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InsertScorePlayers.aspx.cs" Inherits="InsertScorePlayers" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title></title>

    <script type="text/javascript" src="script.js"></script>
    <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
    
    <script type="text/javascript">
    function changeFlag(frm){
       document.getElementById("imgflag").src="img/player_flags/b"+frm[frm.selectedIndex].value+".png";
    }
    function InserPlayerScore(){               
        try{
            $("#okmsg").hide();
            $("#badmsg").hide();
            var pk_tournament = parseInt(document.getElementById("sel_tour")[document.getElementById("sel_tour").selectedIndex].value);

            var IsQualify = false;
            if (document.getElementById("sel_fase")[document.getElementById("sel_fase").selectedIndex].value == "true") {
                IsQualify = true;
            }
            var Player_Number = parseInt(document.getElementById("txt_playernumber").value);
            var Machine_Number = parseInt(document.getElementById("txt_machinenumber").value);
            var Score = document.getElementById("txt_score").value;
            var IsJoker =   document.getElementById("txt_isjoker").checked;
            var res = InsertScorePlayers.InsertScore(pk_tournament, Player_Number, Machine_Number, Score, IsJoker, IsQualify);
           
            if(res.value<0){
                $("#badmsg").fadeIn("slow");    
               
            }else{
                $("#okmsg").fadeIn("slow");                
                
            }
        }catch (error){
            alert(error.description);
        }finally{
        }
    }
    </script>
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="css/style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="css/style.ie7.css" type="text/css" media="screen" /><![endif]-->
</head>
<body>
<form id="form1" runat="server">

    <div class="PageBackgroundGradient"></div>
    <div class="Main">
        <div class="Sheet">
            <div class="Sheet-tl"></div>
            <div class="Sheet-tr"></div>
            <div class="Sheet-bl"></div>
            <div class="Sheet-br"></div>
            <div class="Sheet-tc"></div>
            <div class="Sheet-bc"></div>
            <div class="Sheet-cl"></div>
            <div class="Sheet-cr"></div>
            <div class="Sheet-cc"></div>
            <div class="Sheet-body">
                <div class="Header">
                    <div class="Header-jpeg"></div>
                    <div class="logo">
                        <h1 id="H1_1" class="logo-name"><a href="#">Pinball Tournament Score System</a></h1>
                       <div id="Div1" class="logo-text">v0.8 Magod 2009-2013</div>
                    </div>
                </div>
                <div class="nav">
                	<div class="l"></div>
                	<div class="r"></div>
                		<ul class="artmenu">
                		<li><a href="Main.aspx"><span class="l"></span><span class="r"></span><span class="t">Tournaments</span></a></li>
                		<li><a href="Players.aspx" class="ActiveItem"><span class="l"></span><span class="r"></span><span class="t">Players</span></a>
                		</li>
                		<li><a href="Pinballs.aspx"><span class="l"></span><span class="r"></span><span class="t">Pinballs</span></a></li>
                		<li><a href="Screens.aspx"><span class="l"></span><span class="r"></span><span class="t">Screens</span></a>
                		</li>
                		<li><a href="Config.aspx"><span class="l"></span><span class="r"></span><span class="t">Configuration</span></a></li>
                	</ul>
                </div>
                <div class="contentLayout">
                    <div class="sidebar1">
                      
                        <div class="Block">
                            <div class="Block-tl"></div>
                            <div class="Block-tr"></div>
                            <div class="Block-bl"></div>
                            <div class="Block-br"></div>
                            <div class="Block-tc"></div>
                            <div class="Block-bc"></div>
                            <div class="Block-cl"></div>
                            <div class="Block-cr"></div>
                            <div class="Block-cc"></div>
                            <div class="Block-body">
                                <div class="BlockHeader">
                                    <div class="l"></div>
                                    <div class="r"></div>
                                    <div class="header-tag-icon">
                                        <div class="t">Actions</div>
                                    </div>
                                </div><div class="BlockContent">
                                    <div class="BlockContent-body">
                                        <ul>
                                            <li><a href="Players.aspx">New Player</a></li>
                                             <li><a href="javascript:void(null)">Edit Players (disabled)</a></li>
                                             <li><a href="Players_delete.aspx">Delete Players</a></li>
                                             <li><a href="Players_list.aspx">Player list</a></li>
                                        </ul>
                                        
                                           
                                    </div>
                                    

                                </div>
                            </div>
                        </div>
                        
                    </div>
                    <div class="content">
                       <div class="PostContent">
                                              
                            <h2 class="PostHeaderIcon-wrapper">
                                <span class="PostHeader">Insert Player Score</span>
                            </h2>     
                            <div style="float:left">
                            <fieldset>
<legend>Insert player score</legend>
<p><label for="Flag">Tournament</label> 
    <asp:DropDownList  id="sel_tour" runat="server" Width="184px">
    </asp:DropDownList></p>
    <p><label for="Flag">Tournament Fase</label> 
    <asp:DropDownList  id="sel_fase" runat="server" Width="184px">
    <asp:ListItem Text="Qualify" Selected="True" Value="true"></asp:ListItem>
    <asp:ListItem Text="PlayOffs" Value="false"></asp:ListItem>
    </asp:DropDownList></p>
<p><label for="name">Player Number</label> <input runat="server" maxlength="3" type="text" id="txt_playernumber" /></p>
<p><label for="name">Machine Number</label> <input runat="server" maxlength="15" type="text" id="txt_machinenumber" /></p>
<p><label for="Nick">Score</label> <input runat="server" type="text" maxlength="12" id="txt_score" /><br /></p>
<p><label for="Nick">IsJoker</label> <input runat="server" type="checkbox" maxlength="12" id="txt_isjoker" /><br /></p>


<p class="submit"><input type="button" onclick="InserPlayerScore()" value="Insert Score" /></p>
</fieldset>
</div>                       
<div id="okmsg" style="display:none;float:left; margin:20px 20px 0px 10px; width:280px; padding:10px 10px 10px 10px;  border:1px solid #345536; background-color:#dfe7e0">
    <img src="img/ok.png" class="textmiddle" style="margin-right:10px" /> Operation succesfully    
</div>
<div id="badmsg" style="display:none;float:left; margin:20px 20px 0px 10px; width:280px; padding:10px 10px 10px 10px;  border:1px solid #eb000d; background-color:#ffb6ba">
    <img src="img/wrong.png" class="textmiddle" style="margin-right:10px" /> Operation error
</div>

                                   
                            <div class="cleared"></div>                           
                        </div>                   
                   
                </div>
                <div class="cleared"></div><div class="Footer">
                    <div class="Footer-inner">
                        <a href="#" class="rss-tag-icon" title="RSS"></a>
                        <div class="Footer-text">
                            <p>Copyright Petacos.com&copy; 2012 ---. All Rights Reserved.</p>
                        </div>
                    </div>
                    <div class="Footer-background"></div>
                </div>
        </div>
        <div class="cleared"></div>       
    </div>
        </div></div>
</form>
</body>
</html>

